<script type="text/javascript">

</script>

<h1>Edytuj - Kategoria</h1>

<form action="{url Category=Edit id=$obj->getId()}" method="post" enctype="multipart/form-data">
	<input type="hidden" id="EditCategory" name="EditCategory" value="1" />
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Ustawienia główne</a></h2>
		<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
		{assign var=descArray value=$obj->getAdminDescriptions()}
		{foreach from=$descArray item=desc}
		{assign var=langId value=$desc->getIdLanguage()}
		{assign var=lang value=$languages.$langId}
		{assign var=langCode value=$lang->getCode()}
			<tr>
				<th colspan="2"><strong>Język: {$lang->getName()}</strong></th>
			</tr>		
			<tr>
				<th><strong>Nazwa:</strong></th>
				<td>
					<input type="text" value="{$desc->GetName()}" id="{$langCode}_name" name="{$langCode}[name]"/>
					{if isset($error.$langCode.name)}<p class="validate">{$error.$langCode.name}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Opis</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[description]">{$desc->getDescription()}</textarea>
					{if isset($error.$langCode.name)}<p class="validate">{$error.$langCode.name}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Słowa kluczowe</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[seo_keywords]">{$desc->GetSeoKeywords()}</textarea>
					{if isset($error.$langCode.seo_keywords)}<p class="validate">{$error.$langCode.seo_keywords}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Opis meta</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[seo_description]">{$desc->GetSeoDescription()}</textarea>
					{if isset($error.$langCode.seo_description)}<p class="validate">{$error.$langCode.seo_description}</p>{/if}
				</td>
			</tr>			
		{/foreach}
		</table>
	</div>
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Ustawienia dodatkowe</a></h2>
		<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
			<tr>
				<th><strong>Kategoria nadrzędna:</strong></th>
				<th>
					<select name="parent" id="parent">
						<option value="-1">(brak)</option>
						{foreach from=$mainCategories item=category}
						{assign var=description value=$category->GetCategoryDescription()}
						<option value="{$category->getId()}" {if $obj->getParent() eq $category->getId()}selected="selected"{/if}>{$description->getName()}</option>
						{/foreach}
					</select>
				</th>
			</tr>			
			<tr>
				<th><strong>Url:</strong></th>
				<td>
					<input type="text" value="{$obj->GetSlug()}" id="slug" name="slug"/>
					{if isset($error.slug)}<p class="validate">{$error.slug}</p>{/if}
				</td>
			</tr>	
			<tr>
				<th><strong>Aktywny:</strong></th>
				<td>
					<input type="hidden" name="active" value="0" >
					<input type="checkbox" value="1" {if $obj->GetActive()}checked="checked"{/if} id="active" name="active"/>
					{if isset($error.active)}<p class="validate">{$error.active}</p>{/if}
				</td>
			</tr>	
			<tr>
				<td>Obraz:</td>
				<td><input type="file" name="image" /></td>
			</tr>
			{if strlen($obj->getImage()) gt 0}
			<tr>
				<td>Wgrany plik:</td>
				<td><img src="{$urlStatic}/{image src=$obj->getImage() w=300 h=300}" alt="" /><br />
				<input type="checkbox" name="removeimage" id="removeimage"/> <label for="removeimage">Usuń obraz</label></td>
			</tr>
			{/if}			
		</table>
	</div>	
	
	<p align="right"><input class="cancel" type="button" value="Anuluj" onclick="document.location.href='{url Category='Index'}'" /><input type="submit" value="Zapisz" /></p>
	
</form>


